package com.bawei.login.model

import com.bawei.common.model.BaseRepository
import com.bawei.login.api.LoginApiServer
import com.bawei.login.entity.LoginResultEntity
import com.bawei.net.HttpInterceptorType
import okhttp3.RequestBody

/**
 * Author: Jason Zhang
 * Date: 2024/12/17
 * Desc: 登录模块的仓库
 */
class LoginRepository: BaseRepository<LoginApiServer>(){

    /**
     * 账号登录
     */
    suspend fun loginToServer(body: RequestBody): LoginResultEntity {
        return createApiServer(LoginApiServer::class.java, HttpInterceptorType.SIGN).loginToServer(body)
    }

    /**
     * 注册账号
     */
    suspend fun registerToServer(body:RequestBody): LoginResultEntity{
        return createApiServer(LoginApiServer::class.java, HttpInterceptorType.SIGN).registerToServer(body)
    }

}